<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
/***********************************/
    //includes使用
    // let str = "abcdefg123456";
    // let res = str.includes("5");
    // console.log(res);//true
    // res = str.includes("5",15);
    // console.log(res);//false
/***********************************/
    // let str = "abcdefg123456";
    // let res = str.startsWith("a")//true
    // res = str.startsWith("e",4);
    // console.log(res);//true
    // res = str.endsWith("g",7);
    // console.log(res);//true
/***********************************/
    // let str = "abcdefg123456";
    // let res = str.repeat(-0.3);
    // console.log(res);//""
    // res = str.repeat(3);
    // console.log(res)//abcdefg123456abcdefg123456abcdefg123456
    // res = str.repeat(1.6);
    // console.log(res);//abcdefg123456
/***********************************/
    // let str = "ab";
    // let res = str.padStart(5,"X");
    // console.log(res);//XXXab
    // res = str.padStart(5,"xyz");
    // console.log(res);//xyzab
    // res = str.padStart(7,"xyz");
    // console.log(res);//xyzxyab
/***********************************/
    // let str =  `  `;
/***********************************/
    let str = "abcd";
    str = str.padStart(str.length-1);
    console.log(str) //"abcd"
/***********************************/
</script>
</html>